package com.dwj.auto.comment.common.enums;

/**
 * @ClassName TempLevelEnum
 * @Description 评语模板级别枚举
 * @Author dwjian
 * @Date 2020/1/28 12:55
 */
public enum TempLevelEnum {

    EXCELLENT(1,"优秀"),
    GOOD(2, "良好"),
    QUALIFIED(3, "合格"),
    UNQUALIFIED(4, "不合格");

    private Integer code;
    private String desc;

    TempLevelEnum(int code, String desc){
       this.code = code;
       this.desc = desc;
    }

    public static TempLevelEnum getByCode(int code) {
        for (TempLevelEnum value : TempLevelEnum.values()) {
            if(value.code == code){
                return value;
            }
        }
        return null;
    }

    public static TempLevelEnum getByDesc(String desc) {
        for (TempLevelEnum value : TempLevelEnum.values()) {
            if(value.desc.equals(desc)){
                return value;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
